using System;
using System.Linq.Expressions;
using System.Reflection;

namespace DuplexTransformers
{
    public class DiscoveredProperty
    {
        private readonly string _prefix;
        private readonly PropertyInfo _propertyInfo;

        public DiscoveredProperty(Type type, PropertyInfo propertyInfo, string prefix, LambdaExpression lambdaExpression)
        {
            LambdaExpression = lambdaExpression;
            _propertyInfo = propertyInfo;
            _prefix = prefix;
        }

        public LambdaExpression LambdaExpression { get; private set; }
        public string PrefixedName
        {
            get { return _prefix + _propertyInfo.Name; }
        }
        public Type PropertyType
        {
            get { return _propertyInfo.PropertyType; }
        }
    }
}